<?php

namespace app\admin\model;

use app\admin\model\CommonModel;

class ChangeCoinModel extends CommonModel
{

    //变动类型
    const IN_TYPE  = 1;//收入
    const OUT_TYPE = 2;//支出
    const IN       = [1, 2, 3, 4, 7, 8];//收入的类型
    const OUT      = [5, 6, 9];//支出类型

    const SIGN_IN            = 0;
    const INVITE             = 1;
    const RETURE_MONYE       = 2;
    const READ_ARTICLE       = 3;
    const WATCH_VIDEO        = 4;
    const WITHDRAW_DEPOSIT   = 5;
    const BET                = 6;
    const BET_RETURN_CAPITAL = 7;
    const BET_RETURN_PROFIT  = 8;
    const FOR_GOODS          = 9;

    public static $changeType = [
        self::SIGN_IN            => '签到',
        self::INVITE             => '邀请新人',
        self::RETURE_MONYE       => '被邀请人支付返还',
        self::READ_ARTICLE       => '阅读文章',
        self::WATCH_VIDEO        => '观看视频',
        self::WITHDRAW_DEPOSIT   => '提现',
        self::BET                => '投注消费',
        self::BET_RETURN_CAPITAL => '投注返回本金',
        self::BET_RETURN_PROFIT  => '投注返回盈利',
        self::FOR_GOODS          => '兑换商品',
    ];

    public function member()
    {
        return $this->belongsTo('MemberModel','member_id');
    }



}
